package com.nacos.example.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author wy
 * @date 2022/04/24
 * @description 使用@Value获取项目配置文件中的值，默认读取application.yml或application.properties文件中的值
 **/
@Component
public class TestValue1 {

    @Value("${student.name}")
    private String name;

    @Value("${student.age}")
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
